# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=glide
pkgver=0.6.0
pkgrel=1
pkgdesc='Simple and minimalistic media player based on GStreamer and GTK'
arch=('loong64' 'x86_64')
url='https://github.com/philn/glide'
license=('MIT')
depends=('gst-plugins-bad' 'gst-plugins-base' 'gst-plugins-good' 'gtk4' 'libadwaita')
makedepends=('meson' 'rust')
optdepends=('gst-libav: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs')
replaces=('glide-player')
source=("https://github.com/philn/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.xz"
    fix-build.patch)
sha256sums=('b764217bb0a0192f12055b855b15dcfbb832590084f92f81ac318558dd27d8a0'
            'd90a7cb94bc7be015167d40c2f8d5e1019ca2c77647bcfcbf2dbaa633eb4983d')

prepare() {
  patch -d $pkgname-$pkgver -p1 < fix-build.patch
}

build() {
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"
  install -Dm644 $pkgname-$pkgver/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
